﻿<UserControl x:Class="EyeOpen.Crypt.Silverlight.Encryption"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    xmlns:ControlsToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit">
    <StackPanel
        Margin="5,5,5,5"
        DataContext="{Binding Path=CryptViewModel, Source={StaticResource viewModelLocator}}">
        <Grid Margin="0,0,0,5">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="150"/>
            </Grid.ColumnDefinitions>
            <StackPanel
                Margin="0,0,5,0"
                Grid.Column="0" 
                Grid.RowSpan="2">
                <TextBlock Text="Password"/>
                <TextBlock
                    Margin="0,10,0,0"
                    Text="Re-type password" />
            </StackPanel>
            <StackPanel
                Grid.Column="1" 
                Grid.RowSpan="2">
                <PasswordBox
                    VerticalContentAlignment="Center"
                    Height="20"
                    MaxLength="20"
                    Password="{Binding Password, Mode=TwoWay,NotifyOnValidationError=True,ValidatesOnExceptions=True}"
                />
                <PasswordBox
                    VerticalContentAlignment="Center"
                    Margin="0,5,0,0"
                    Height="20"
                    MaxLength="20"
                    Password="{Binding RetypedPassword, Mode=TwoWay,NotifyOnValidationError=True,ValidatesOnExceptions=True}"
                />
            </StackPanel>
        </Grid>
        <TextBox
            Height="300"
            AcceptsReturn="True"                
            VerticalScrollBarVisibility="Auto"
            HorizontalScrollBarVisibility="Auto" 
            Text="{Binding CryptText, Mode=TwoWay,NotifyOnValidationError=True}" />
    </StackPanel>
</UserControl>